// 人脸入库功能

// 人脸入库
$('#uploadFaceBtn').click(function() {
    const originalText = showLoading('uploadFaceBtn');
    var formData = new FormData($('#uploadFaceForm')[0]);
    
    $.ajax({
        url: '/upload_face',
        type: 'POST',
        data: formData,
        processData: false,
        contentType: false,
        success: function(response) {
            showResult('uploadResult', response.message, true);
            resetUploadArea('uploadUploadArea');
            updateStats();
        },
        error: function(xhr) {
            showResult('uploadResult', '上传失败: ' + xhr.responseText, false);
        },
        complete: function() {
            restoreButton('uploadFaceBtn', originalText);
        }
    });
}); 